// #ifdef VUE3
import App from "./App";
import "./style/global.scss";
import uviewPlus from "uview-plus";
import { createPinia } from "pinia";
import { createSSRApp } from "vue";
import navBar from "./components/navBar"; //全局导航栏
import customPopup from "./components/customPopup";
import customSearch from "./components/customSearch"; //全局搜索框
import customNumBox from "./components/customNumberBox";
import customTreeSelect from "./components/tree-vue3/tree.vue";
import customListDe from './components/customDetailList'
import bus from "@/utils/eventBus";
import { hasPerm } from "@/utils/permission";
import { pick, cloneDeep } from "@/utils/permission";
uni.$bus = bus; // uni 全局对象可直接访问（推荐）
uni.$lodash = { pick, cloneDeep };
uni.$zp = {
  config: {
    //配置分页默认pageSize为15
    "default-page-size": 15,
    //配置空数据图默认描述文字为：空空如也~~
    "empty-view-text": "暂无数据",
    //...
  },
};

export function createApp() {
  const app = createSSRApp(App);
  app.use(uviewPlus);
  app.use(createPinia());
  app.config.globalProperties.$hasPerm = hasPerm;
  app.component("nav-bar", navBar);
  app.component("custom-popup", customPopup);
  app.component("custom-tree-select", customTreeSelect);
  app.component("custom-search", customSearch);
  app.component("custom-num-box", customNumBox);
  app.component("custom-list-de", customListDe);
  return {
    app,
  };
}
// #endif
